package remotecontrolcase.command.ceilingfan;

import remotecontrolcase.command.Command;
import remotecontrolcase.component.CeilingFan;

/**
 * description:
 *  关闭吊扇命令类
 * @author yuanmenglv on 2019/11/30
 */
public class CeilingFanOffCommand implements Command {
    private CeilingFan ceilingFan;

    public CeilingFanOffCommand(CeilingFan ceilingFan) {
        this.ceilingFan = ceilingFan;
    }

    @Override
    public void execute() {
        ceilingFan.off();
    }

    @Override
    public void undo() {
        System.out.println("撤销中");
        ceilingFan.on();
    }
}
